//
//  registerPayViewController.m
//  marrymarry
//
//  Created by lsj on 16/9/12.
//  Copyright © 2016年 cf. All rights reserved.
//

#import "registerPayViewController.h"

@interface registerPayViewController ()
@property (weak, nonatomic) IBOutlet UIButton *payRightNowBtn;
@property (weak, nonatomic) IBOutlet UILabel *oldPriceLabel;
@property (weak, nonatomic) IBOutlet UIView *grayBackGroundVeiw;
@property (weak, nonatomic) IBOutlet UIView *ChoseView;
@property (weak, nonatomic) IBOutlet UIButton *cancelPayBtn;
@property (weak, nonatomic) IBOutlet UIButton *goPayBtn;
@property (weak, nonatomic) IBOutlet UIView *chosePayStyle;

@end

@implementation registerPayViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    
    self.navigationController.navigationBarHidden = YES;
    self.navigationController.navigationBar.hidden = YES;
    self.ChoseView.layer.cornerRadius = 5;
   self.payRightNowBtn.layer.cornerRadius = 5;
    self.cancelPayBtn.layer.cornerRadius = 5;
    self.goPayBtn.layer.cornerRadius = 5;
    NSMutableAttributedString *newPrice = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@",self.oldPriceLabel.text]];
    [newPrice addAttribute:NSStrikethroughStyleAttributeName value:@(NSUnderlinePatternSolid | NSUnderlineStyleSingle) range:NSMakeRange(0, newPrice.length)];
    self.oldPriceLabel.attributedText = newPrice;
    
    
    UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(cancelTap)];
    [self.grayBackGroundVeiw addGestureRecognizer:tap];
    
}

-(void)cancelTap
{
    self.ChoseView.hidden = NO;
    self.chosePayStyle.hidden = YES;
    self.grayBackGroundVeiw.hidden=NO;
}


/** 这里是支付失败之后 回来弹出提示 **/

#pragma mark ------- 现在去支付
- (IBAction)goPayNowBtn:(UIButton *)sender {
    self.chosePayStyle.hidden = NO;
}
#pragma mark -------- 取消支付
- (IBAction)goCancelBtn:(UIButton *)sender {
//    [self cancelTap];
    self.ChoseView.hidden = YES;
    self.grayBackGroundVeiw.hidden = YES;
}






#pragma mark ------- 选择支付方式选项
- (IBAction)payNowBtn:(UIButton *)sender {
    self.chosePayStyle.hidden = NO;
    self.grayBackGroundVeiw.hidden=NO;
    self.ChoseView.hidden = NO;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
